<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="form-group">
     <label for="">步骤名字</label><input type="text" class="form-control" name="name" />
</div>

<div class="form-group">
     <label for="">过滤id</label><input type="text" class="form-control" name="filter_id" />
</div>

<div class="form-group">
    <label for="">步骤类型</label>
    <div class="radio">
{#        解决表单传值错乱bug的hiden input#}
        <label><input type="hidden" name="method" value=""/></label>
        <label><input type="radio" name="method" value="r"/>http接口请求</label> &#12288;
        <label><input type="radio" name="method" value="s"/>sql语句</label> &#12288;
        <label><input type="radio" name="method" value="l"/>linux shell</label>
    </div>
</div>

<div class="form-group">
    <label for="">是否执行</label>
    <div class="checkbox">
        <label><input type="checkbox" name="ifdo" >是</label> &#12288;
    </div>
</div>

<div class="form-group">
     <label for="">执行顺序(自动整十增长)</label><input type="text" class="form-control" name="order" />
</div>

<div class="form-group">
     <label for="">前延迟(s)</label><input type="text" class="form-control" name="delay_after"  />
</div>

<div class="form-group">
     <label for="">后延迟(s)</label><input type="text" class="form-control" name="delay_before" />
</div>

<div class="form-group">
     <label for="">执行次数</label><input type="text" class="form-control" name="docounts"  />
</div>

<div class="form-group">
     <label for="">重试次数</label><input type="text" class="form-control" name="retry" />
</div>

<div class="form-group">
     <label for="">最大等待时间(s)</label><input type="text" class="form-control" name="timeout" />
</div>

<div class="form-group">
     <label for="">最终返回结-正则</label><input type="text" class="form-control" name="final_res_re" />
</div>

<div style="color: green">

<div class="form-group">
     <label  for="">http(s)请求方式</label><input type="text" class="form-control" name="request_method" />
</div>
<div class="form-group">
     <label for="">http(s)请求url</label><input type="text" class="form-control" name="request_url" />
</div>
<div class="form-group">
     <label for="">http(s)请求体</label><input type="text" class="form-control" name="request_body" />
</div>
<div class="form-group">
     <label for="">http(s)请求体类型</label><input type="text" class="form-control" name="request_body_method" />
</div>
<div class="form-group">
     <label for="">http(s)请求头</label><input type="text" class="form-control" name="request_headers" />
</div>

<div class="form-group">
    <label for="">http(s)请求是否加密/验签</label>
    <div class="checkbox">
        <label><input type="checkbox" name="request_sign" >是</label> &#12288;
    </div>
</div>

<div class="form-group">
    <label for="">http(s)请求是否带证书</label>
    <div class="checkbox">
        <label><input type="checkbox" name="request_cert" >是</label> &#12288;
    </div>
</div>
<div class="form-group">
    <label for="">http(s)请求是否代理</label>
    <div class="checkbox">
        <label><input type="checkbox" name="request_proxy">是</label> &#12288;
    </div>
</div>
<div class="form-group">
     <label for="">http(s)请求断言返回值-字符串</label><input type="text" class="form-control" name="request_assert_str" />
</div>
<div class="form-group">
     <label for="">http(s)请求提取返回值-正则</label><input type="text" class="form-control" name="request_extract_re" />
</div>
<div class="form-group">
     <label for="">http(s)请求提取返回值-路径</label><input type="text" class="form-control" name="request_extract_path" />
</div>

<div class="form-group">
     <label for="">http(s)请求提分组登录态/cookie持久化</label><input type="text" class="form-control" name="request_group" />
</div>

</div>

<div style="color: #ff9900">


<div class="form-group">
     <label for="">sql组件id</label><input type="text" class="form-control" name="sql_fixture" />
</div>
<div class="form-group">
     <label for="">sql语句</label><input type="text" class="form-control" name="sql_body" />
</div>
<div class="form-group">
     <label for="">sql断言返回值-字符串</label><input type="text" class="form-control" name="sql_assert_str" />
</div>
<div class="form-group">
     <label for="">sql提取返回值-下标</label><input type="text" class="form-control" name="sql_extract_index" />
</div>
</div>

<div style="color: #1d7db1">
<div class="form-group">
     <label for="">linux组件id</label><input type="text" class="form-control" name="linux_fixture" />
</div>
<div class="form-group">
     <label for="">linux语句</label><input type="text" class="form-control" name="linux_body" />
</div>
<div class="form-group">
     <label for="">linux断言返回值-字符串</label><input type="text" class="form-control" name="linux_assert_str" />
</div>
<div class="form-group">
     <label for="">linux提取返回值-正则</label><input type="text" class="form-control" name="linux_extract_re" />
</div>
</div>

<script>
    function show_step(ret){
        console.log(ret.res)
        for(var key in ret.res){
            var step_val = ret.res[key]
            try{
                document.getElementsByName(key)[0].value = step_val// 自动填充input text
                $('input:checkbox[name="'+key+'"]').attr('checked',step_val)// 自动填充input checkbox
                $('input:radio[name="'+key+'"][value="'+step_val+'"]').attr('checked','true')// 自动填充input radio
            }catch{
                console.log(key)
            }
        }
    }
</script>

</body>
</html>